package com.strp.mptcp.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author 曹行阳
 * @version 0.1
 * @date 2025/6/12 13:00
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "mptcp")
public class MPTCPConfig {
    private Server server;
    private Chunk chunk;
    private Timeout timeout;
    private Metrics metrics;
    private Storage storage = new Storage();

    @Data
    public static class Server {
        private List<Address> addresses;
    }

    @Data
    public static class Address {
        private String host;
        private int port;
    }

    @Data
    public static class Chunk {
        private int size;
        private int maxRetries;
    }

    @Data
    public static class Timeout {
        private int connection;
        private int read;
        private int write;
    }

    @Data
    public static class Metrics {
        private boolean enabled;
        private Export export;
    }

    @Data
    public static class Export {
        private int interval;
    }

    @Data
    public static class Storage {
        private String uploadDir = "uploads";
        private String downloadDir = "downloads";
        private String tempDir = "temp";
    }
}
